UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jfms4dQc3CH1aShyGk3FyQRmzsRhkHcZurfxyBu5E1U='
WHERE
key_id = '95122b9673d7d45df28289d958f0d99259ea485b750e53a4633b4d5ae0c3571f'
AND (
token = 'Jfms4dQc3CH1aShyGk3FyQRmzsRhkHcZurfxyBu5E1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)