UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xOQa+bsT2jQ+K4L5IGd3/Go2ALHbuRqvl1hAw5b5xkU=' 
WHERE 
  key_id = 'e652e83c5a0978da33af0c492a20904e6f6352ef115ce3cab161e57ef83bdc5a' 
  AND (
    token = 'xOQa+bsT2jQ+K4L5IGd3/Go2ALHbuRqvl1hAw5b5xkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013