UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6bg6gafJwhFL91GTxQGVNKo9m4ow2BkPI6eD32+Mzg='
WHERE
key_id = 'ea7c9818d261eba94c874c92935a46d47396492834e842cf806a384db76d0edd'
AND (
token = 'F6bg6gafJwhFL91GTxQGVNKo9m4ow2BkPI6eD32+Mzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)