UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LG6RbHj6ILKDOh8YJcEwLUI5SDf9SKHdjpPlZTAUeYA='
WHERE
key_id = 'ffed8dbf6f3095f5bc276e168b7a0cfe6316f449471ee2dbac9e51d5e642a8c5'
AND (
token = 'LG6RbHj6ILKDOh8YJcEwLUI5SDf9SKHdjpPlZTAUeYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)