UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NekyF56fmiR9npPbi9jpGbJtrYbWupMKd8rlo7nNzsg='
WHERE
key_id = '71477e310d3d762af05bb09916d70615675e98c9d1d1ac264007fe3987e3b40c'
AND (
token = 'NekyF56fmiR9npPbi9jpGbJtrYbWupMKd8rlo7nNzsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)