UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vOcWq7ebTaPJ5cCGoYEIZGkzpF8OUGWfTW7+nLayprw=' 
WHERE 
  key_id = '86d2a4b3945723ba79ac5ab663a7e012ba179e31fcd91697615ddaf7dc82e286' 
  AND (
    token = 'vOcWq7ebTaPJ5cCGoYEIZGkzpF8OUGWfTW7+nLayprw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039