UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2QjHGYjE5cmvPcFtDFud1+Jsfj1y/ZtcfosLhymNryE='
WHERE
key_id = '952166d9a67bb9f3a697fb053c8d616113076f244f9aa7c827bb5bd2fe4e00bd'
AND (
token = '2QjHGYjE5cmvPcFtDFud1+Jsfj1y/ZtcfosLhymNryE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)