UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ql35/Xvx5nn77y52VIhp13Yjy+EbB03irbeFvm8KT/A=' 
WHERE 
  key_id = '3f8e53c2dd6715ec0776dc49f09b3bc2309aec4280eb43a2bf399fb62345eaac' 
  AND (
    token = 'ql35/Xvx5nn77y52VIhp13Yjy+EbB03irbeFvm8KT/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032