UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYbwP+5z77haazk2GyuiYraBzziA+gXWstTPQHbX5sU='
WHERE
key_id = '9dcfb4bd72215a775bb19ebf0ae130962e4b5726f0aa40c2dbbcd6a200e165fd'
AND (
token = 'SYbwP+5z77haazk2GyuiYraBzziA+gXWstTPQHbX5sU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)