UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7dYB07FaVQSGAAEGng7IT4oh3aBrwGPfzF5Z1HNWfhs='
WHERE
key_id = 'a74d7f367d80e0923c64d0450e0961a2dde38cf9827eb07b52d4e347a59bcbc5'
AND (
token = '7dYB07FaVQSGAAEGng7IT4oh3aBrwGPfzF5Z1HNWfhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)