UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vGGSQHXF8t6FCmpCOtlHt4y9zjEQTC/g4Mq2QKBlzQo='
WHERE
key_id = 'd7223047c7f5f4899d4da734f7ab5844950a737b1f353e2014b9b561f3747da0'
AND (
token = 'vGGSQHXF8t6FCmpCOtlHt4y9zjEQTC/g4Mq2QKBlzQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)