UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nTJZ55oR+vqr+Wsz9oYduAvxifH+74JPshyiVP1ysE0=' 
WHERE 
  key_id = '60b25e93f299a8b7b316deb5fe3fd3b7eccb241e406d600193c8320ed3f0f192' 
  AND (
    token = 'nTJZ55oR+vqr+Wsz9oYduAvxifH+74JPshyiVP1ysE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039