UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZklMJxuoWPzCVIm9Io80Yzz72vd7W9Lt8ugPJVHq3hY=' 
WHERE 
  key_id = '42214b9c1ba7942b455250f8d2e5d9ac2a3f1e94bf00cb3df54d47a375d3e9b7' 
  AND (
    token = 'ZklMJxuoWPzCVIm9Io80Yzz72vd7W9Lt8ugPJVHq3hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051