UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jFZk1aBSM2pHKUOWnjAhE5pm500HJ5NfjPXvuXX2Ug4=' 
WHERE 
  key_id = '0ff6b1929567c3b9c686f2ff11086c0dda445f8de9a87bf93a27cc9d0aff5f27' 
  AND (
    token = 'jFZk1aBSM2pHKUOWnjAhE5pm500HJ5NfjPXvuXX2Ug4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022