UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uG1n5tJo9Qn8ESbR6b+35Zg+mSnh1jmxkKAB+R194X4=' 
WHERE 
  key_id = '81ff92fd2b0fb224164e52fa17ef8d98257afe61fd043821ff8e554ff7506b42' 
  AND (
    token = 'uG1n5tJo9Qn8ESbR6b+35Zg+mSnh1jmxkKAB+R194X4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026