UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+OZwGhzUPrQMdU4eznQJJAKIZMTJ/TztCilNoKHM8+o='
WHERE
key_id = 'b3d6d4002fcfda52e83ed9c2fc18045b3ccedc02ca2abecc80d9809e1dc4750d'
AND (
token = '+OZwGhzUPrQMdU4eznQJJAKIZMTJ/TztCilNoKHM8+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)