UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cGMY6Vxa30CkGNt3CX1vX4UPZ2CNjMU1mRaHi5x6x3M=' 
WHERE 
  key_id = '65f3dafccfefdbeb36d6ef4f1762d7d4a5453b50e053e2f9b9a191ad3ed630b2' 
  AND (
    token = 'cGMY6Vxa30CkGNt3CX1vX4UPZ2CNjMU1mRaHi5x6x3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043