UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yebLft5XJ9rwykwkAJBLG/kYjLw9UFD/5cMFBNIvInQ=' 
WHERE 
  key_id = '22e301dd1cf0daf9d134a9a09e3f59c13f048e28553571f22b37cdcf75b3fdc8' 
  AND (
    token = 'yebLft5XJ9rwykwkAJBLG/kYjLw9UFD/5cMFBNIvInQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028