UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dL0LD2sw9n1uXXGDp+yaextDb8e3sf/yhf7TuNXc4E=' 
WHERE 
  key_id = '2acbe1ddf6da0fe212e255a2b04cee3751501b940c28b9eadaaf4aedb3d5e513' 
  AND (
    token = '7dL0LD2sw9n1uXXGDp+yaextDb8e3sf/yhf7TuNXc4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026