UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WWZPtBZM1MDhHGfvqh62Qgx0Fl+GlB1k+kUxOUJ3GJ0='
WHERE
key_id = 'c60740146bd1a9bbb3bbdad073d5b9ad0eb1b4df965e0b2e5dcfb2561f15e362'
AND (
token = 'WWZPtBZM1MDhHGfvqh62Qgx0Fl+GlB1k+kUxOUJ3GJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)