UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1DFyiRwdKSkjXziJQ7Hn5i7P182KFkZGXEvIWGBkQU='
WHERE
key_id = '11c2e4019b129c4eb3f91f6759e6c32df759065473ee1b17287acc84f605b02a'
AND (
token = 'k1DFyiRwdKSkjXziJQ7Hn5i7P182KFkZGXEvIWGBkQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)