UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6FEYXc4SpA8hFcNAzhnBsiVt5MTiSoI6A+kU2vPAfEA='
WHERE
key_id = 'dbe746c626164382a78264e3d96c0661d8e57d9fc7e837542ced7bf48f986836'
AND (
token = '6FEYXc4SpA8hFcNAzhnBsiVt5MTiSoI6A+kU2vPAfEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)