UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W1LggMNt6V9fwC1NWTr/bYfClXzVMY/1IgQmIq8jrXE='
WHERE
key_id = 'e7fa7e2df0687e5ec606ea0afe30b0c36da999cb92824cfc046ea553ce91e633'
AND (
token = 'W1LggMNt6V9fwC1NWTr/bYfClXzVMY/1IgQmIq8jrXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)