UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'odquQP3wVNDNmbY7Yfmd+nksFseiIFfSpFP8xzmyUWw='
WHERE
key_id = 'f70ef31f5d1a1a44c7634fce0c7c83df7dc4ae2d25a6ffd6e92632abbc85f4ab'
AND (
token = 'odquQP3wVNDNmbY7Yfmd+nksFseiIFfSpFP8xzmyUWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)