UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bfIJ0omOxrQ7Y8XaJcOIJVjz9UkuhmqOiOto0KP2hk='
WHERE
key_id = 'd8793ac871c4eafe792a9fdcf0ce75e30e81ceebfe78fe2a8b9c5866eeaef737'
AND (
token = '0bfIJ0omOxrQ7Y8XaJcOIJVjz9UkuhmqOiOto0KP2hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)