UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bc//Vnsqbh8ctFTApZAk7+aJLM0fJdUMW30S6/cbZIk='
WHERE
key_id = '6d2338e35886765f2992d28019a7457c9dc65fc098d4a10b3e13b3bec45ff244'
AND (
token = 'bc//Vnsqbh8ctFTApZAk7+aJLM0fJdUMW30S6/cbZIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)