UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RPCd3vAlIfWvpYfp/u7AiKZ4+GjxdSB7XpynUyk7GP8=' 
WHERE 
  key_id = '7279e0c18c4a8b7a73267071af726cc198f3fdfe2eff4aba0ac8eaa9dd4fac7b' 
  AND (
    token = 'RPCd3vAlIfWvpYfp/u7AiKZ4+GjxdSB7XpynUyk7GP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069