UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rEYpGR1wsdKbj16eTIEL65rgasCKqozYSGqk8ZXyRno=' 
WHERE 
  key_id = 'ff807cda374378157259caffdb8cdc54d266a3c06639a31668c36fe31acd291a' 
  AND (
    token = 'rEYpGR1wsdKbj16eTIEL65rgasCKqozYSGqk8ZXyRno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021