UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QN0UrKcETTQvvF9OtUIoKFkElTB0aOJP/GnRhM1Nzag=' 
WHERE 
  key_id = 'da98b3b95321bf52b8aea319a8ced99118f4f2c8a490d9b07c7715f8657dc6d2' 
  AND (
    token = 'QN0UrKcETTQvvF9OtUIoKFkElTB0aOJP/GnRhM1Nzag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035