UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9mWYgIj/W3l/CxH9PXHIfm0AMZSAiKTxx+B2DenubCA='
WHERE
key_id = '9e4c8ef3c091f2c62cfaff5e15a52b6b05bda28fc7381a1674965ad5af3db8db'
AND (
token = '9mWYgIj/W3l/CxH9PXHIfm0AMZSAiKTxx+B2DenubCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)