UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PwqAhpZYhIv36KqRd6SPd6jTkkmD4VVYjCxWdkoOa70='
WHERE
key_id = 'eca26479c316a69cbec98c6ae09fe349e52ed9d49313490bdbb17d1b87e8635a'
AND (
token = 'PwqAhpZYhIv36KqRd6SPd6jTkkmD4VVYjCxWdkoOa70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)