UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+cgOcFAFLDXzGC095XcMEZ/nvSUf4gNtY7gPH5XoO1w='
WHERE
key_id = '053b111410ec6b55e74da56d034acd2c55deb88d06ef575e9358832427b754c3'
AND (
token = '+cgOcFAFLDXzGC095XcMEZ/nvSUf4gNtY7gPH5XoO1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)