UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LTyQwgj3XAi2w4+si7NekNSb0XZbIQQa8LMZ0Y/kajM='
WHERE
key_id = '0d578afb1e697b8e34e76c5386ee654fda89826fa4e51ef79927a52c05470ee2'
AND (
token = 'LTyQwgj3XAi2w4+si7NekNSb0XZbIQQa8LMZ0Y/kajM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)