UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QfKpWx22p2amtLa6THQ/gIj7Np31qpPwU8oMr7T96/s=' 
WHERE 
  key_id = 'b0f5e4a5b11d32a4c185ed5e3975004c74dbb8d8da33e00915f2a54fecaa3e68' 
  AND (
    token = 'QfKpWx22p2amtLa6THQ/gIj7Np31qpPwU8oMr7T96/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021