UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yEFzDbJmhlZ5Oo8S9fIaHbRPaXhdGMjglVm7A/eIwCc=' 
WHERE 
  key_id = '213d09dc1f5ec52bc3091c71286a53722345011f951731832aafdac48f30ed36' 
  AND (
    token = 'yEFzDbJmhlZ5Oo8S9fIaHbRPaXhdGMjglVm7A/eIwCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036