UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '62KcIwt1jDjhv3OWMH6EIbqlKcmMIuzdoUmSA52S4OE=' 
WHERE 
  key_id = '5e6f43e5d9742827be3f32b912a603671981378a17c0cdb47ec113329499e430' 
  AND (
    token = '62KcIwt1jDjhv3OWMH6EIbqlKcmMIuzdoUmSA52S4OE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051