UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AEwzSVvJBoBh1asXw8XC0o6lIx+q3DmqnIneDAzFhsM='
WHERE
key_id = '27981281739be29b20189d099f5ea38ff96ad4fb4cdaefb95e0c5110a7976fbe'
AND (
token = 'AEwzSVvJBoBh1asXw8XC0o6lIx+q3DmqnIneDAzFhsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)