UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fu7pfI2Dkn0fJ/q1rPkwj0J1m2H8Wk1VlPn0LwKfmxk=' 
WHERE 
  key_id = 'cf2ab35f0957f913a720fb7ee5d4a4ac07d40e5d74945fce436982b9c5734131' 
  AND (
    token = 'Fu7pfI2Dkn0fJ/q1rPkwj0J1m2H8Wk1VlPn0LwKfmxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050