UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UfOjB5vJCevJbfClx2GRAFA3RoXW0U1B9s40sItn/Is='
WHERE
key_id = 'aa293e21c71aa23243a5c6dac84a6270dea15042ed266e6aa112cfc9f86380fd'
AND (
token = 'UfOjB5vJCevJbfClx2GRAFA3RoXW0U1B9s40sItn/Is='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)